﻿package mortal.game.view.doubleHang
{
    import Message.Public.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.game.cache.*;
    import mortal.game.manager.*;
    import mortal.game.manager.msgTip.*;
    import mortal.game.resource.*;
    import mortal.game.view.activeTime.*;
    import mortal.game.view.common.*;

    public class DoubleHangIcon extends ActionBaseIcon
    {
        private static var _instance:DoubleHangIcon;

        public function DoubleHangIcon(param1:String)
        {
            super(param1);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            return;
        }// end function

        override protected function clickHandler(event:MouseEvent) : void
        {
            if (Cache.instance.role.entityInfo.level < 50)
            {
                MsgManager.showRollTipsMsg(Language.getString(11701), MsgRollTipsType.msgRollTips3);
            }
            else if (!ActiveTimeUtil.isInDoubleTimeByType(EActiveType._EActiveTypeDoubleHang))
            {
                MsgManager.showRollTipsMsg(Language.getStringByParam(11702, currentTimeStr), MsgRollTipsType.msgRollTips3);
            }
            else
            {
                this.stopEffect();
                DoubleHangWindow.instance.show();
            }
            return;
        }// end function

        public static function get instance() : DoubleHangIcon
        {
            if (!_instance)
            {
                _instance = new DoubleHangIcon(ResFileConst.HangUpIcon);
            }
            return _instance;
        }// end function

        public static function get isViewShow() : Boolean
        {
            return _instance && !_instance.isHide;
        }// end function

        public static function get hasInstance() : Boolean
        {
            return _instance != null;
        }// end function

    }
}
